package com.app.service.student.impl;

import com.app.mapper.student.login.StudentLoginMapper;
import com.app.pojo.Student;
import com.app.service.student.StudentLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class StudentLoginServiceImpl implements StudentLoginService {

    @Autowired
    StudentLoginMapper studentLoginMapper;

    @Override
    public Student login(String userId, String password) {
        Student student = studentLoginMapper.login(userId);
        if(student==null){
            return null;
        }else if(student.getPassword().equals(password)){
            return  student;
        }
        return null;
    }
}
